home *** CD-ROM | disk | FTP | other *** search
- Path: goanna.cs.rmit.EDU.AU!not-for-mail
- From: ok@goanna.cs.rmit.EDU.AU (Richard A. O'Keefe)
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2
- Subject: Re: Hungarian notation
- Date: 25 Jan 1996 20:28:21 +1100
- Organization: Comp Sci, RMIT, Melbourne, Australia
- Message-ID: <4e7ifl$et3@goanna.cs.rmit.EDU.AU>
- References: <30C40F77.53B5@swsbbs.com> <4bd <4cc2b2$11jq@navajo.gate.net> <4cud8f$gup@news.netvision.net.il> <4dttefINNo29@keats.ugrad.cs.ubc.ca> <Pine.HPP.3.91.960122145028.27524A-100000@clear.cs.byu.edu> <dewar.822407363@schonberg> <Pine.HPP.3.91.960124153551.24374C-100000@zeezrom.cs.byu.edu>
- NNTP-Posting-Host: goanna.cs.rmit.edu.au
- NNTP-Posting-User: ok
- X-Newsreader: NN version 6.5.0 #0 (NOV)
-
- Douglas Evan Cook <cookd@cs.byu.edu> writes:
- >ADT's are great, but somebody has to make the ADT's, don't they? And the
- >ADT's sure better be able to cross version/module/language/disk boundaries
- >- i.e. if you write a DLL, you have to be sure that the types your
- >procedure receives are compatible with what you expect; if you save to
- >disk in a file format common to multiple programs, you better be able to
- >tell how big each item in the file is. So you can't hide behind the
- >"Abstract Data Type" jargon - I know what it is, and they are the same as
- >any other data type at least once in the code: where they are
- >implemented.
-
- About DLLs I will remain silent.
- About saving data in a file or shipping it across a network,
- I'm not quite sure that I understand the point, or agree with what I
- think it means.
-
- Suppose there is some package that defines a type Pack.T
- where I don't have access to the representation, only the operations.
- As long as there is a Pack.T'Write and a Pack.T'Read (forgive me if
- I've got the syntax a bit wrong, I'm still learning about Ada 95
- streams) *I* don't have to know what the size of an instance of the
- type is in the file. The size appears explicitly nowhere in my code.
-
- There are programming languages where appropriate 'pickling' and
- 'unpickling' routines can be automatically generated by the compiler.
- Indeed, with the aid of rpcgen (see various UNIX "Network Programming
- Guide"s) you can even count C as one of these languages. "save to
- XDR stream" and "load from XDR stream" are just two more operations
- on the abstract type.
-
- If those operations are not provided, that means that the designer
- of the ADT doesn't want you to do that.
-
- >In M2, the size
- >of the data type "CARDINAL" (in C this is unsigned int) is compiler
- >dependant (sic).
-
- Programming languages which (a) place arbitrary restrictions on integer
- sizes and then (b) refuse to tell you in advance what the restrictions
- are make life harder than it needs to be. If I were managing a software
- product, anyone who wasn't writing an assembler or something like that
- and went around defining CARD16 or CARD32 would be asked coldly but
- politely to provide an immediate explanation. (Perhaps my B6700 background
- is still showing: I think 39 bits + sign is a good size for an integer...)
-
- --
- "conventional orthography is ... a near optimal system for the
- lexical representation of English words." Chomsky & Halle, S.P.E.
- Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.
-